package com.yz.crm.system.constant;

import com.yz.crm.db.model.BaseRole;

/**
 * 特殊角色枚举-系统角色
 * */
public enum SpecialRoleEnum {

	/**未知角色*/
	Unknown("未知","unknown"){
		
	},
	/**超级管理员*/
	SuperAdmin("超级管理员","super_admin"){
		
	},
	/**公司管理员*/
	CompanyAdmin("公司管理员","company_admin"){
		
	};
	
	private String name;
	private String code;
	
	private SpecialRoleEnum(String name , String code) {
		this.name = name;
		this.code = code;
	}
	
	public String getCode() {
		return code;
	}
	
	public BaseRole createRole(){
		BaseRole role = new BaseRole();
		role.setName(name);
		role.setCode(code);
		
		return role;
	}
}
